package com.spboot.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import com.spboot.service.PermissionService;
import com.spboot.service.RoleService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author guocb
 * @since 2019-12-25
 */
@Controller
@RequestMapping("/role")
public class RoleController {
	@Autowired
	RoleService roleService;
	
	@Autowired
	PermissionService permissionService;
	
	@RequestMapping("/list")
	public String list(Model model){
		model.addAttribute("roleList",roleService.list());
		return "rolelist";
	}
	
	@RequestMapping("/roleadd")
	public String roleadd(Model model){
		model.addAttribute("permList",permissionService.list());
		return "roleadd";
	}
}

